package com.rgp.internalcommon.utils;

import com.rgp.internalcommon.common.UrlConstants;
import java.util.Map;

/**
 * @author nhp
 * @version 1.0
 * @description TODO
 * @date 2024-04-15 0:51
 */
public class JointUrlUtils {

    public static String combineUrlAndParameters(String url, Map<String,String> map){
        StringBuilder builder = new StringBuilder();
        builder.append(url);
        int index = 0;
        for (Map.Entry<String,String> entry : map.entrySet()){
            builder.append(entry.getKey());
            builder.append("=");
            builder.append(entry.getValue());
            index++;
            if (index != map.size()){
                builder.append("&");
            }
        }
        return builder.toString();
    }
}